package com.lost.octopus.es.processor.entity.query;

import com.lost.octopus.es.helper.annotation.EsDocument;
import com.lost.octopus.es.helper.annotation.EsSearch;
import com.lost.octopus.es.helper.constant.EsSearchMode;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryBlankWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryMultiplyKeyWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryMultiplyValPrefixWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryMultiplyValWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryPrefixWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryRangeAgeWrapper;
import com.lost.octopus.es.helper.entity.wrapper.EsQueryRangeWrapper;
import com.lost.octopus.es.processor.config.es.wrapper.EsQueryMultiplyKeyValueWrapper;

import java.util.List;

import lombok.Data;

/**
 * 查询人员实体
 * @author zhangbh
 **/
@Data
@EsDocument(indexName = "tag-resident")
public class FindResident {

    /**
     * 人口编号多值查询，数组
     */
    @EsSearch(name = "id", queryType = EsQueryMultiplyValWrapper.class)
    private List<Integer> rkbhs;

    /**
     * 全等查询，房屋ID T_DZ_FW.FWBH
     */
    @EsSearch(name = "roomIds")
    private Integer roomId;

    /**
     * 全等查询，楼栋ID T_DZ_LD.LDBH
     */
    @EsSearch(name = "buildingIds")
    private Integer buildingId;

    /**
     * 全等查询，地址ID T_DZ.DZBH
     */
    @EsSearch(name = "addressIds")
    private Integer addressId;

    /**
     * 全等查询，区划查询
     */
    @EsSearch(name = "regionNos")
    private String regionNo;

    /**
     * 全等查询，姓名
     */
    @EsSearch
    private String name;
    /**
     * 全等查询，手机号码
     */
    @EsSearch
    private String tel;

    /**
     * 全等查询，性别 DM_RK_XB
     */
    @EsSearch
    private String gender;

    /**
     * 全等查询，民族 DM_RK_MZ
     */
    @EsSearch
    private String nation;
    /**
     * 全等查询，婚姻状态 DM_RK_HYZT
     */
    @EsSearch
    private String marriage;

    /**
     * 多值查询，数组
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class)
    private String[] idNumber;

    /**
     * 范围查询，长度为2， 下标0为开始1结束 ，gte，lte
     */
    @EsSearch(queryType = EsQueryRangeWrapper.class, name = "birth")
    private Integer[] birthdayRange;

    /**
     * 年龄查询，长度为2， 下标0为开始1结束 ，gte，lte
     */
    @EsSearch(queryType = EsQueryRangeAgeWrapper.class, name = "birth")
    private Integer[] age;

    /**
     * 多值查询，逗号隔开。必须包含所有标签 and 1 and 2...
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "tags", searchMode = EsSearchMode.SEARCH_MUST)
    private String[] tagsAllIn;

    /**
     * 人员类别
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "rylb")
    private List<String> rylbIn;


    /**
     * 地址编号IN (小区筛选时可以使用)
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "addressIds")
    private List<Integer> dzbhIn;

    /**
     * 医保缴费年IN
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "ybjfYears")
    private List<String> ybjfYearsIn;

    /**
     * 医保缴费年IN
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "ybjfYears", searchMode = EsSearchMode.SEARCH_MUST_NOT)
    private List<String> ybjfYearsNotIn;

    /**
     * 网格编号查询，T_DZ_DYWG.WGBH
     */
    @EsSearch(name = "grids")
    private String grid;

    /**
     * 多网格编号查询 或关系
     */
    @EsSearch(queryType = EsQueryMultiplyValWrapper.class, name = "grids")
    private List<String> gridIn;

    /**
     * 户籍地详址查询
     */
    @EsSearch
    private String hjdxz;

    /**
     * 现居住地查询
     */
    @EsSearch
    private String address;

    /**
     * 人员类别，DM_RK_RYLB
     */
    @EsSearch
    private String rylb;

    /**
     * 人户状态 DM_RK_RHZT
     */
    @EsSearch
    private String rhzt;
    /**
     * 政治面貌 DM_RK_ZZMM
     */
    @EsSearch
    private String zzmm;

    /**
     * 文化程度 DM_RK_WHCD
     */
    @EsSearch
    private String whcd;

    /**
     * 最后核实时间范围查询
     */
    @EsSearch(queryType = EsQueryRangeWrapper.class)
    private String zhhssj;

    /**
     * 未核实时间范围查询
     */
    @EsSearch(queryType = EsQueryRangeWrapper.class, name = "zhhssj", searchMode = EsSearchMode.SEARCH_MUST_NOT)
    private String notVerifyTime;


    /**
     * 家庭医生签约-签约标识 0：未签约，1：已签约，按N次导入次数标识第N位，如第一次导入，第二次不导入，则应该为10
     */
    @EsSearch
    private String hdSign;

    /**
     * 查询 hdSign 不为空的值
     */
    @EsSearch(queryType = EsQueryBlankWrapper.class, name = "hdSign")
    private String hdSignNotBlank;

    /**
     * 家庭医生签约-登记状态 DM_HD_QYBS
     */
    @EsSearch
    private String hdDjzt;


    /**
     * 小区xzqh  前缀查询
     */
    @EsSearch(queryType = EsQueryPrefixWrapper.class, name = "communitys")
    private String communitys;

    /**
     * 公安单位前缀查询，如果多个逗号隔开 T_AUTH_ORG
     */
    @EsSearch(queryType = EsQueryMultiplyValPrefixWrapper.class, name = "gadws")
    private String gadw;

    /**
     * 街路巷多值查询
     */
    @EsSearch
    private String jlx;

    /**
     * 门牌号码,列表查询
     */
    @EsSearch(name = "mphm", queryType = EsQueryMultiplyValWrapper.class)
    private List<String> mphmIn;

    /**
     * 或查询，区划查询
     */
    @EsSearch(name = "regionNos", queryType = EsQueryMultiplyValWrapper.class)
    private List<String> regionNoIn;

    /**
     * 或查询，区划查询 (行政区划，网格编号)
     */
    @EsSearch(queryType = EsQueryMultiplyKeyValueWrapper.class, otherParam = "regionNos,grids")
    private List<String> regionNoOrGridIn;

    /**
     * 姓名、证件号码搜索
     */
    @EsSearch(queryType = EsQueryMultiplyKeyWrapper.class, otherParam = "name,idNumber")
    private String nameOrIdNumber;

    /**
     * 境外人员类型
     */
    @EsSearch
    private String jwrylx;

    /**
     * 境外人员类型 IN查询
     */
    @EsSearch(name = "jwrylx", queryType = EsQueryMultiplyValWrapper.class)
    private List<String> jwrylxIn;

    /**
     * 是否新就业群体 0否1是
     */
    @EsSearch
    private String isNewJob;
}
